/*
 * Copyright (c) 2013.
 * 游戏服务器核心代码编写人陈磊拥有使用权
 * 联系方式：E-mail:13638363871@163.com ;qq:502959937
 * 个人博客主页：http://my.oschina.net/chenleijava
 */

package com.dc.gameserver.serverCore.service.battle.coreBattleLogic.singleCardType;

import com.dc.gameserver.hardCode.CardType;
import com.dc.gameserver.serverCore.service.battle.coreBattleLogic.AbstractSingleLogic;
import com.dc.gameserver.serverCore.service.cardModule.CardBox;
import com.dc.gameserver.serverCore.service.cardModule.CardBoxManager;
import com.dc.gameserver.serverCore.service.character.GameCharacter;
import org.springframework.stereotype.Service;

/**
 * @author 石头哥哥</br>
 *         Project : gameServer1.1</br>
 *         Date: 13-11-2  11</br>
 *         Time: 下午11:02</br>
 *         Connect: 13638363871@163.com</br>
 *         packageName: Server.ServerCore.Service.fightProcess.singleCardType</br>
 *         注解：
 */
@Service
public class singleDeffenceLogic extends AbstractSingleLogic {
    @Override
    public void PostConstruct() {
        SINGLES[CardType.DEFENCE_TYPE.getType()]=this;
    }
    /**
     * 处理不同类型牌的逻辑
     * @param p1   出牌玩家  ，p1使用任何牌有效  p1使用防御
     * @param p2   没有出牌的玩家
     */
    @Override
    public void SingleLogicHandle(GameCharacter p1,GameCharacter p2) {
        CardBox cardBox= CardBoxManager.getCardBoxByID(p1.getCardBoxID());
        CardBoxManager.DeffenceCompute(p1);
        cardBox.flushBloodAndMagic();
        cardBox.resetRoundResource();
    }
}
